package com.zbp.model;

import com.mybatisflex.annotation.KeyType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Proxy;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 用户
 *
 * @Api注释上面的是jpa|下面的是MyBatis
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Entity
@Table
@Proxy(lazy = false)
@ApiModel(value = "用户信息")
@com.mybatisflex.annotation.Table("user")
public class User implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "ID")
    @com.mybatisflex.annotation.Id(keyType = KeyType.Auto)
    private Long id;

    //@NotBlank(message = "名字不能为空")
    @Column(nullable = false, columnDefinition = "varchar(20) comment '姓名'")
    @ApiModelProperty(value = "名称")
    @com.mybatisflex.annotation.Column(value = "name")
    private String name;

    @Column(nullable = false, columnDefinition = "varchar(100) comment '密码'")
    @ApiModelProperty(value = "密码")
    @com.mybatisflex.annotation.Column(value = "pass_word")
    private String passWord;

    @Column(nullable = false, columnDefinition = "int(1) default 0 not null comment '状态：0正常，1删除'")
    @ApiModelProperty(value = "状态")
    @com.mybatisflex.annotation.Column(value = "status")
    private int status;
}
